import { get } from 'lodash'

export default (items, unit) => {
  const plan = items.find(i => i.type === 'plan' && i.status === 'active')
  return get(plan, ['metadata', unit]) || {}
}
